import { createRouter, createWebHashHistory } from "vue-router";
const Home = () => import("../views/home/index");
const Ordering = () => import("../views/ordering/index");
const User = () => import("../views/user/index");
//搜索页面
const UseSearch = () => import("@/components/search/searchPage");
//关于我们页面
const ProductAbout = () => import("../views/productAbout/index");
//工作人员页面
const StaffWorker = () => import("../views/staffWorker/index");
//食谱记录页面
const DietRecords = () => import("../views/dietRecords/index");
//登录页面
const UserLogin = () => import("../views/user/component/UserLogin");

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/productAbout",
    name: "ProductAbout",
    component: ProductAbout,
  },
  {
    path: "/staffWorker",
    name: "StaffWorker",
    component: StaffWorker,
  },
  {
    path: "/dietRecords",
    name: "DietRecords",
    component: DietRecords,
  },
  {
    path: "/ordering",
    name: "Ordering",
    component: Ordering,
  },
  {
    path: "/user",
    name: "User",
    component: User,
  },
  {
    path: "/user/login",
    name: "UserLogin",
    component: UserLogin,
  },
  {
    path: "/useSearch",
    name: "UseSearch",
    component: UseSearch,
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
